<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>mysql-pm</title>
    <script type="text/javascript" src="{{asset('home/js/jquery-3.1.0.min.js')}}"></script>
</head>
<body>
<table border="1">
    <thead>
    <tr>
        <td>Id</td>
        <td>Time</td>
        <td>Command</td>
        <td>State</td>
        <td>Info</td>
    </tr>
    </thead>
    <tbody>

    </tbody>
</table>

<script>
    var $tbody = $('table>tbody');
    setInterval(function () {
        $.ajax({
            url: 'http://www.qiyiguo.tv/mysql-pm/data',
            dataType: 'json'
        }).done(function (rows) {
            $tbody.html('');
            rows.filter(row => row.Command !== 'Sleep')
            .map(row => {
                $tbody.append(`
<tr>
                <td>${row.Id}</td>
                <td>${row.Time}</td>
                <td>${row.Command}</td>
                <td>${row.State}</td>
                <td>${row.Info}</td>
                </tr>
`)
        })
        })
    }, 6000);
</script>
</body>
</html>